home *** CD-ROM | disk | FTP | other *** search
- Path: leeds.ac.uk!news
- Newsgroups: comp.lang.c
- Subject: HELP - malloc
- Message-ID: <1996Mar27.143834.6017@leeds.ac.uk>
- From: csyamc@scs.leeds.ac.uk (A M Casey)
- Date: Wed, 27 Mar 1996 14:38:33 +0000 (GMT)
- Organization: The University of Leeds, School of Computer Studies
- NNTP-Posting-Host: csgi08.leeds.ac.uk
-
- I pass this character string into a function, defined as
-
- ItemName *char
-
- and I have already allocated memory (ItemName=malloc(50)) and
- set it to a value. It gets into the function fine, but when I call
- another function, passing ItemName to it, the function changes it
- to become nothing, although I dont see why. The function which is
- called does use malloc to allocate memory for other strings, but shouldnt
- change ItemName in any way.
-
- Has malloc overwritten my previously defined string or something?
-
-
- PLEASE PLEASE PLEASE help
-
- cheers
-
- Andy
-
-
-